Expose abandoned transaction product params in filters#459
Merged
yusuftor merged 5 commits intosuperwall:developfrom Apr 28, 2026
Merged
Conversation
Contributor
Author
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Thanks @yusuftor ❤️ |
Collaborator
|
Thanks for submitting! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When configuring a paywall trigger for
transaction_abandon, the dashboard filter UI only exposesabandoned_product_id.The SDK already includes richer abandoned product metadata in the internal
$product_*parameter set, but those fields are not copied into the explicit event parameter payload that powers the filter picker. As a result, you cannot target different paywalls based on the abandoned product duration.Intended use case
The goal is to show a different rescue paywall depending on which subscription duration was abandoned. For example:
Right now that workflow is blocked because
transaction_abandondoes not expose duration-related fields in the filter UI.Solution
abandoned_product_*event parametersabandoned_product_idfieldtransaction_abandonparameter setNotes
This addresses the App Store abandon path where a real
StoreProductis available. Stripe/web checkout abandon still only has product ID in the current model, so duration-based filtering for that path would require additional Stripe product metadata to be tracked.Greptile Summary
This PR copies
StoreProduct.attributesinto thetransaction_abandonaudience filter params under anabandoned_product_*prefix, guarded by!product.period.isEmptyso that Stripe/web products (which return an empty period) are unaffected. TheSKProductSubscriptionPeriodMockis updated from a hardcodednumberOfUnits: 1to a configurable init to support the new test, following the same pattern already used byMockSkProduct.Confidence Score: 5/5
This PR is safe to merge; the change is additive, well-guarded, and consistent with the existing product_* attribute pattern.
No P0 or P1 issues found. The !product.period.isEmpty guard correctly scopes the new params to App Store subscription products, the identifier key is explicitly excluded to avoid a duplicate with the separately set abandoned_product_id, and the implementation mirrors the pre-existing product_* pattern in PaywallInfo.audienceFilterParams(). Test coverage uses actual-value assertions for all new fields.
No files require special attention.
Important Files Changed
Flowchart
%%{init: {'theme': 'neutral'}}%% flowchart TD A[Transaction.abandon state] --> B{product != nil?} B -- No --> E[return audienceFilterParams] B -- Yes --> C["set abandoned_product_id"] C --> D{"product.period.isEmpty?"} D -- "Yes - Stripe/web product" --> E D -- "No - App Store subscription" --> F["iterate product.attributes\nexcluding 'identifier' key"] F --> G["add abandoned_product_period\nabandoned_product_period_months\nabandoned_product_price, etc."] G --> EReviews (3): Last reviewed commit: "Remove stray character in CHANGELOG" | Re-trigger Greptile